function test()
    x=[];f=[];y=[];
    test3();
    function test3()
        syms f x;
        f=1-exp(-1*x);
        h=0.2;n=5;
        X=zeros(n+1,1);Y=zeros(n,1);Y1=zeros(n+1,1);Y2=zeros(n+1,1);
        X=[0:h:1];Y1(1)=0;Y1(2)=0.181;Y2(1)=0;Y2(2)=0.181;
        for i=1:n+1
            Y(i)=eval(subs(f,x,X(i)));
        end
        for i=1:n-1
            Y1(i+2)=(1-1.5*h)*Y1(i+1)+h/2*Y1(i)+h;
        end
        for i=2:n
            Y2(i+1)=(2-h)/(2+h)*Y2(i)+2*h/(2+h);
        end
        Y
        Y1
        Y2
    end
    test2();
    function test2()
        syms f x y;
        f=3*y/(1+x);
        h=0.2;n=5;
        X=zeros(n+1,1);Y=zeros(n+1,1);K1=zeros(n+1,1);
        K2=zeros(n+1,1);K3=zeros(n+1,1);K4=zeros(n+1,1);
        X=[0:0.2:1];Y(1)=1;
        for i=1:n
            K1(i)=eval(subs(f,[x,y],[X(i),Y(i)]));
            K2(i)=eval(subs(f,[x,y],[X(i)+h/2,Y(i)+h/2*K1(i)]));
            K3(i)=eval(subs(f,[x,y],[X(i)+h/2,Y(i)+h/2*K2(i)]));
            K4(i)=eval(subs(f,[x,y],[X(i)+h,Y(i)+h*K3(i)]));
            Y(i+1)=Y(i)+h/6*(K1(i)+2*K2(i)+2*K3(i)+K4(i));
        end
        Y
    end
    test1();
    function test1()
        syms f x
        h=0.1;
        n=5;
        X=[0.1:0.1:0.6];
        Y=zeros(n+1,1);
        Y2=zeros(n+1,1);
        Y(1)=1;Y2(1)=1;
        f=-x-1+2*exp(x);
        for i=1:n
            Y(i+1)=(1+h+h^2/2)*Y(i)+(h+h^2)/2*X(i)+h/2*X(i+1);
            Y2(i+1)=eval(subs(f,x,i*0.1));
            fprintf("0.%d %9f %9f\n",i+1,Y(i+1), Y2(i+1));
        end
        X
        Y
        Y2
    end
end